//api为网络收集，大家喜欢的壁纸保存即可，希望不要滥用，源用坏了大家都没得用
function getWallpaperSecondMenu(){
    let res = {};
    let d = [];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/wallpaper/getWallpaperSecondMenu?projectID=2",{}));
    d.push({
        title:'<big><h1 style="text-align:center"><font color="#00BCD4">遥望</font></h1><big>',
        col_type:"rich_text"
    });
    for(let i = 0; i < jsoncode.data.wallpapermenu.length-1;i++){
        let menus = jsoncode.data.wallpapermenu[i];
        for(let t = 0; t < 5; t++ ){
            d.push({
                col_type:"big_blank_block"
        })
        }
        d.push({
            title:menus.appShowName,
            url:"hiker://empty#fypage#"+menus.jumpFunction,
            col_type:"text_center_1"
        })
    }
    res.data = d;
    setResult(res);
}

//头像壁纸
function getheadWallpaper(){
    let res = {};
    let d = [];
    let page = MY_URL.split("#")[1];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/wallpaper/getheadWallpaper?pageNo="+page+"&pageSize=30",{}));
    for(let i = 0; i < 30;i++){
        let wallpapers = jsoncode.data.headWallpaper[i];
        d.push({
            title:"tu",
            pic_url:wallpapers.imageOne,
            url:wallpapers.imageOne,
            col_type:"pic_3"
        })
    }
    res.data = d;
    setResult(res);
}
//朋友圈壁纸
function getbackWallpaper(){
    let res = {};
    let d = [];
    let page = MY_URL.split("#")[1];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/wallpaper/getbackWallpaper?pageNo="+page+"&pageSize=30",{}));
    for(let i = 0; i < 30;i++){
        let wallpapers = jsoncode.data.backWallpaper[i];
        d.push({
            title:"tu",
            pic_url:wallpapers.imageOne,
            url:wallpapers.imageOne,
            col_type:"pic_3"
        })
    }
    res.data = d;
    setResult(res);
}
//今日壁纸
function getindexrecpaster(){
    let res = {};
    let d = [];
    let page = MY_URL.split("#")[1];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/user/getindexrecpaster?pageNo="+page+"&pageSize=10",{}));
    for(let i = 0; i < 10;i++){
        let wallpapers = jsoncode.data.recpaster[i];
        d.push({
            title:"tu",
            pic_url:wallpapers.image,
            url:wallpapers.image,
            col_type:"pic_1_full"
        })
    }
    res.data = d;
    setResult(res);
}
//互动壁纸
function getinteractwallpaper(){
    let res = {};
    let d = [];
    let page = MY_URL.split("#")[1];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/user/getinteractwallpaper?pageNo="+page+"&pageSize=10",{}));
    for(let i = 0; i < 10;i++){
        let wallpapers = jsoncode.data.interactwallpaper[i];
        d.push({
            title:"🔸"+((10 * (page-1)+ i + 1))+"-1",
            pic_url:wallpapers.imageOne,
            url:wallpapers.imageOne,
            col_type:"movie_2"
        })
        d.push({
            title:"🔸"+(10 * (page-1)+ i + 1)+"-2",
            pic_url:wallpapers.imageTwo,
            url:wallpapers.imageTwo,
            col_type:"movie_2"
        })
    }
    res.data = d;
    setResult(res);
}
//热门精选
function getadvertisrec(){
    let res = {};
    let d = [];
    let page = MY_URL.split("#")[1];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/user/getadvertisrec?pageSize=12&pageNo="+page,{}));
    for(let i = 0; i < 12;i++){
        let wallpapers = jsoncode.data.wallpapers[i];
        d.push({
            title:"tu",
            pic_url:wallpapers.image,
            url:wallpapers.image,
            col_type:"pic_1_full"
        })
    }
    res.data = d;
    setResult(res);
}
//分类壁纸
//获取分类列表
function getwallpaperclassification(){
    let res = {};
    let d = [];
    let page = MY_URL.split("#")[1];
    let jsoncode = JSON.parse(fetch("https://app.jinglantech.tech/user/getwallpaperclassification?photoSize=0&pageSize=12&pageNo="+page,{}));
    if(page == 1){
        d.push({
            title:"推荐",
            pic_url:jsoncode.data.hotWallpaperClass.wallpapers[0].image.split("?")[0],
            url:$("https://app.jinglantech.tech/user/getwallpaperclassificationdetails?photoSize=810&classId="+jsoncode.data.hotWallpaperClass.id+"&pageSize=12&pageNo=fypage").rule(()=>{
                let res = {};
                let d = [];
                let rescode = getResCode();
                let detailcode = JSON.parse(rescode);
                for(let j= 0; j < 12;j++){
                    let wallpapers = detailcode.data.wallpapers[j];
                    d.push({
                        title:"tu",
                        pic_url:wallpapers.image,
                        url:wallpapers.image,
                        col_type:"pic_1_full"
                    })
                }
                res.data = d;
                setResult(res);
            }),
            col_type:"movie_3"
        })
    }
    for(let i = 0; i < jsoncode.data.wallpaperClass.length;i++){
        let wallpapers = jsoncode.data.wallpaperClass[i];
        d.push({
            title:wallpapers.wallpaperClassName,
            pic_url:wallpapers.wallpapers[0].image.split("?")[0],
            url:$("https://app.jinglantech.tech/user/getwallpaperclassificationdetails?photoSize=810&classId="+wallpapers.id+"&pageSize=12&pageNo=fypage").rule(()=>{
                let res = {};
                let d = [];
                let rescode = getResCode();
                let detailcode = JSON.parse(rescode);
                for(let j= 0; j < 12;j++){
                    let wallpapers = detailcode.data.wallpapers[j];
                    d.push({
                        title:"tu",
                        pic_url:wallpapers.image,
                        url:wallpapers.image,
                        col_type:"pic_1_full"
                    })
                }
                res.data = d;
                setResult(res);
            }),
            col_type:"movie_3"
        })
    }
    res.data = d;
    setResult(res);
}
